
#ifndef TIME_H
#define TIME_H

#ifndef _TM_DEFINED
#define _TM_DEFINED

typedef struct tm_s tm_t;

struct tm_s {
  char tm_sec;                   // Seconds after the minute [0, 59]
  char tm_min;                   // Minutes after the hour [0, 59]
  char tm_hour;                  // Hours since midnight [0, 23]
  char tm_mday;                  // Day of the month [1, 31]
  char tm_mon;                   // Months since January [1, 12]
  short tm_year;                  // Years since 1900
  char tm_wday;                  // Days since Sunday [0, 6]
//	  short tm_yday;                  // Days since January 1 [0, 365]
//	  char tm_isdst;                 // Daylight Saving Time flag
//	  int tm_gmtoff;                // Seconds east of UTC
//	  char *tm_zone;                // Timezone abbreviation
};

#endif

#ifdef  __cplusplus
extern "C" {
#endif

void fun_localtime(struct tm_s *tmbuf, unsigned long tim);
unsigned long fun_mktime(struct tm_s *tmbuf);
int func_checktime(struct tm_s *tm);
//void fun_mktime(struct tm_s * pT, long * tmp);

#ifdef  __cplusplus
}
#endif

#endif
